package ar.edu.utn.frba.tacs.warnes.beans;

import java.util.ArrayList;
import java.util.List;

import ar.edu.utn.frba.tacs.warnes.entities.Auto;
import ar.edu.utn.frba.tacs.warnes.entities.BaseEntity;
import ar.edu.utn.frba.tacs.warnes.utils.ContenedorWarnes;

/**
 * @author dmiglino
 */
public class AutoBrowseBean extends BaseBrowseBean {
	private List<Auto> autos = new ArrayList<Auto>();

	public AutoBrowseBean() {
		this.setAutos(ContenedorWarnes.getInstance().getAutos());
	}
	
	public List<Auto> getAutos() {
		return this.autos;
	}

	public void setAutos(List<Auto> autos) {
		this.autos = autos;
	}

	@Override
	protected void cargarDataModel() {
		this.dataModel.setWrappedData(getAutos());
	}

	@Override
	protected void doBeforeEliminar(BaseEntity entity) {
		ContenedorWarnes.getInstance().borrarAuto((Auto)entity);
	}

}
